package ch.esn.server.domain;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;
import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Message {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private User fromUser;

	@Persistent
	private User toUser;

	@Persistent
	private String subject;

	@Persistent
	private Text text;

	@Persistent
	private Boolean readByRecepient;

	@Persistent
	private Date sendDate;

	public User getFromUser() {
		return fromUser;
	}

	public Key getKey() {
		return key;
	}

	public Boolean getReadByRecepient() {
		return readByRecepient;
	}

	public Date getSendDate() {
		return sendDate;
	}

	public String getSubject() {
		return subject;
	}

	public Text getText() {
		return text;
	}

	public User getToUser() {
		return toUser;
	}

	public void setFromUser(User fromUser) {
		this.fromUser = fromUser;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public void setReadByRecepient(Boolean readByRecepient) {
		this.readByRecepient = readByRecepient;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public void setText(Text text) {
		this.text = text;
	}

	public void setToUser(User toUser) {
		this.toUser = toUser;
	}
}
